<template>
      <component :is="dynamicComponent"></component>
</template>

<script setup>
import { defineProps,defineAsyncComponent, computed,getCurrentInstance } from 'vue';
const props = defineProps({
   componentName: {
      type: String,
      default: ""
   }
});
// 动态导入组件
const dynamicComponent = computed(() => {
   return defineAsyncComponent(() => {
      return import(`./${props.componentName}.vue`);
   });
});
</script>
<style scoped lang='scss'></style>
